/**
 * 
 */
package com.sree.library.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.sree.domain.BaseDomain;
import com.sree.organization.Subject;

/**
 * @author srinivasr
 *
 */
@Entity
@Table(name = "BOOK_SUBJECT_MAP")
@SuppressWarnings("serial")
public class BookSubjectMap extends BaseDomain {
	@Column(name = "ID")
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	@ManyToOne 
	@JoinColumn(name="SUBJECT_ID", nullable=false)
	private Subject subject = new Subject();
	
	@ManyToOne 
	@JoinColumn(name="BOOK_ID", nullable=false)
	private Book book=new Book();

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Subject getSubject() {
		return subject;
	}

	public void setSubject(Subject subject) {
		this.subject = subject;
	}

	public Book getBook() {
		return book;
	}

	public void setBook(Book book) {
		this.book = book;
	}
}
